<extend name='Public/base'/>

<block name='body'>
    <div class='main-tile'>
        <h2>订单列表</h2>
    </div>
    <div class='cf'>
        <!-- 按钮工具栏 -->
        <div class='f1'>
            <!--<button class="btn ajax-post confirm" url="{:U('check')}" target-form="ids">删 除</button>-->
            <!--<button class="btn ajax-post confirm" url="{:U('check')}" target-form="ids">审 核</button>-->
        </div>
        <!-- 高级搜索栏 -->
        <div class='data-table'>
            <table class="">
                <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th>订单编号</th>
                    <th>微信昵称</th>
                    <th>群主姓名</th>
                    <th>群主电话</th>
                    <th>订单金额</th>
                    <th>创建时间</th>
                    <th>是否核销</th>
                </tr>
                </thead>
                <tbody>
                <volist name='list' id='vo'>
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.order_id}" /></td>
                        <td>{$vo.order_sn}</td>
                        <td>{$vo.nickname}</td>
                        <td>{$vo.user_name}</td>
                        <td>{$vo.user_phone}</td>
                        <td>{$vo.price}</td>
                        <td>{$vo.create_time|time_format='Y-m-d'}</td>
                        <eq name="vo['check']" value="1">
                            <td style="color: #008200">已核销</td>
                            <else/>
                            <td><a class="confirm ajax-get" href="{:U('Tickets/check?id='.$vo['order_id'])}">核 销</a> </td>
                        </eq>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        /* 状态搜索子菜单 */
        $(".search-form").find(".drop-down").hover(function(){
            $("#sub-sch-menu").removeClass("hidden");
        },function(){
            $("#sub-sch-menu").addClass("hidden");
        });
        $("#sub-sch-menu li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu").addClass("hidden");
            })
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Tickets/Order')}');
    </script>
</block>
